package com.itheima.service.impl;

import com.itheima.mapper.UserSetmealMapper;
import com.itheima.pojo.Setmeal;
import com.itheima.service.UserSetmealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@Slf4j
public class UserSetmealServiceImpl implements UserSetmealService {
    @Autowired
    private UserSetmealMapper userSetmealMapper;

    /**
     * 套餐全部查询
     * @return
     */
    @Override
    public List<Setmeal> findAll() {
        List<Setmeal> setmealList=  userSetmealMapper.findAll();
        return setmealList;
    }

    /**
     * 根据套餐id查询套餐详情
     * @param id
     * @return
     */
    @Override
    public Setmeal findById(String id) {
        Integer setmealId = Integer.valueOf(id);
        Setmeal setmeal = userSetmealMapper.findById(setmealId);
        return setmeal;
    }
}
